home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / ASTRONOM / H139.ZIP / RO101.ZIP / RO_VAR.C < prev    next >
C/C++ Source or Header  |  1991-11-04  |  6KB  |  149 lines

  1. /********************************************************/
  2. /*                            */
  3. /*    ro_var.c    Global variables for ro        */
  4. /*                            */
  5. /*    ro version 1.10                    */
  6. /*                            */
  7. /*    Portions copyright (c) 1989 by Ted A. Campbell    */
  8. /*        Bywater Software            */
  9. /*        P. O. Box 4023                */
  10. /*        Duke Station                */
  11. /*        Durham, NC  27706            */
  12. /*                            */
  13. /*    Contains portions of ROFF4, Version 1.60    */
  14. /*      (c) 1983, 4 by Ernest E. Bergmann               */
  15. /*        Physics, Building #16            */
  16. /*        Lehigh University            */
  17. /*        Bethlehem, Pa. 18015            */
  18. /*                            */
  19. /*    Contains portions of ROFF4, Version 1.61    */
  20. /*      (c) 1985 by Konrad Kwok                         */
  21. /*        20 3rd Street, Section M        */
  22. /*        Fariview Park,                */
  23. /*        Hong Kong                */
  24. /*                            */
  25. /*    ro and its predecessor ROFF4 are based on     */
  26. /*    the ROFF text processor described in Kernigan    */
  27. /*    and Plauger's now-classic text <Software Tools> */
  28. /*                            */
  29. /* Permission is hereby granted for all commercial and    */
  30. /* non-commercial reproduction and distribution of this */
  31. /* material provided this notice is included.        */
  32. /*                            */
  33. /********************************************************/
  34.  
  35. /************* INCLUDE FILES ****************************/
  36.  
  37. #include "ro.h"
  38.  
  39. /****** GLOBAL VARIABLES ********************************/
  40.  
  41. FILE     *_dobuf, *instream;    /* i/o buffer used for direction  */
  42. #ifdef    DEBUG
  43. int     ro_debug;        /* Boolean:  debug mode on/off */
  44. #endif
  45. int    ro_verbose;        /* Boolean:  verbose mode on/off */
  46. int     ro_pagestop;
  47. int     ro_adjust;
  48. int     ro_useff;
  49. int     ro_firstpage, ro_lastpage;    /* for selectively printing output*/
  50. int     ro_suppress;        /* if true,no output is passed by putchar()*/
  51. int     ro_tival;      /* temporary indent -> default  0 */
  52. int     ro_ceval;      /* set equal to number of lines to be centered  */
  53. int     ro_spval;      /* blank lines to be spaced down */
  54. int     ro_curpag;     /* current output page number; init = 0 */
  55. int     ro_newpag;     /* next output page number; init = 1 */
  56. int     ro_vlineno;    /* virtual (intended) line advances on page,
  57.                         see vadv()*/
  58. int     ro_vflineno;   /* + line fraction */
  59. int     ro_plineno;    /* printer's actual line advances on page,
  60.                         see padv()*/
  61. int     ro_pflineno;   /* + line fraction */
  62. int     ro_bottom;     /* end of text area in lines;start of M3+M4 */
  63. int     ro_sentence;   /* Nov 20*/
  64. int    ro_poval;    /* page offset */
  65.  
  66. /***    Stack variables
  67.  
  68.     The following variables are assigned to a stack and when 
  69.     a new value is assigned, it is "pushed" onto the stack, 
  70.     and when read, "popped" off.  The stack is read from 
  71.     the bottom.                          ***/
  72.  
  73. int     ro_fill[STKSIZ];       /* set to YES or NO  */
  74. int     ro_lsval[STKSIZ];      /* line spacing value -> default will be 1  */
  75. int     ro_inval[STKSIZ];      /* left indent -> default  0  */
  76. int     ro_rmval[STKSIZ];      /* right margin -> default  PAGEWIDTH  */
  77. int     ro_tcval[STKSIZ];      /* translation flag char  */
  78. int     ro_plval[STKSIZ];      /* page length in lines  */
  79. int     ro_m1val[STKSIZ];      /* margin before& including header in lines */
  80. int     ro_m2val[STKSIZ];      /* margin after header in lines */
  81. int     ro_m3val[STKSIZ];      /* margin after last text line in lines */
  82. int     ro_m4val[STKSIZ];      /* bottom margin, including footer in lines */
  83. int     ro_scval[STKSIZ];      /* space character  */
  84. int     ro_tabsiz[STKSIZ];     /* spacing of tabstops  */
  85. int     ro_cfval[STKSIZ];      /* Dec 4:control flag character value  */
  86. int     ro_icval[STKSIZ];      /* insert character */
  87.  
  88. char     ro_curline[ LSZ ];       /*input line buffer, Nov 26 */
  89. char     ro_ehead[ LSZ ], ro_eh2[ LSZ ], ro_eh3[ LSZ ];    /* even header title  */
  90. char     ro_ohead[ LSZ ], ro_oh2[ LSZ ], ro_oh3[ LSZ ];    /* odd header title  */
  91. char     ro_efoot[ LSZ ], ro_ef2[ LSZ ], ro_ef3[ LSZ ];    /* even footer title  */
  92. char     ro_ofoot[ LSZ ], ro_of2[ LSZ ], ro_of3[ LSZ ];    /* even footer title  */
  93.  
  94. char     tbuf[ TBUFSIZE ];    /* a temporary buffer */
  95. int     ro_dir;        /* for "spreading" of lines     */
  96. int     ro_outwrds;    /* no. words in ro_outbuf; init = 0  */
  97. char     ro_outbuf[ LSZ ];     /*lines to be filled collected here  */
  98. int     ro_outw;       /*current display width of ro_outbuf */
  99. int     ro_outpos;     /* =strlen(ro_outbuf)  */
  100. int     ro_wtop, ro_ltop, ro_outtop;   /*zero|negative;levels of subscripts */
  101. int     ro_wbot, ro_lbot, ro_outbot;   /*zero|positive;levels of subscripts */
  102. int     ro_oldln;              /*position of previous main line */
  103. int     ro_oldbot;             /*ro_outbot for previous line;reset
  104.                         each page */
  105. int     ro_frq, ro_frval;  /* fractional line?, what fraction size */
  106. char     *ro_frstring; /* ^ to code for fractional spacing */
  107. char     *ro_whstring; /* ^ to code for whole line spacing */
  108. char     *ro_cptr[128-' '];    /*pointer table for print control */
  109. char     *ro_tptr[128-' '];    /*pointer table for translation strings
  110.                           for char; initialize to null  */
  111.  
  112. struct     divfd *dlink;    /* points to head of diversion list  */
  113. struct     divfd *rlink;    /* points to head of register variable list  */
  114. struct     divfd *slink;    /* points to head of linked string list  */
  115. struct     divfd *mlink;    /* points to head of linked macro list  */
  116.  
  117. /*following added for buffered and formatted output:   */
  118.  
  119. char     ro_out2buf[LSZ];      /*for line to be output in fancy fmt */
  120. int     ro_bpos, ro_cp, ro_pp;         /*buffer,column,printer positions */
  121. char     ro_xbuf[LSZ];         /*strikout buffer */
  122. int     ro_xf, ro_xcol;            /* " flag and column  */
  123. char     ro_ubuf[LSZ];         /*underline buffer */
  124. int     ro_uf, ro_ucol;            /* " flag and column  */
  125. int     ro_first;              /*flag for first pass */
  126. char     ro_dbuf[LSZ];         /*double strike buffer */
  127. int     ro_dpos;
  128. int     ro_ocnt;
  129. int     ro_mcnt;
  130. int     ro_blkcnt;
  131.  
  132. int     ro_newxf, ro_newuf, ro_newmcnt; /* 3rd Mar,85 ; Conrad Kwok  */
  133. char     ro_lastch;    /* 5th Mar,85  ;  Conrad Kwok  */
  134.  
  135. char     ro_backbuf[BACKSIZE];                 /* Backup buffer  */
  136. int     ro_binp;                               /* Position in above;init to 0  */
  137. char     ro_keybd;             /*boolean & prompt for keyboard input */
  138. char     ro_kline[MAXLINE];    /*keyboard line input buffer */
  139. char     *ro_kptr;             /*pointer for above */
  140.  
  141. int         ro_fptr;
  142. FILE     *ro_fstack[FMAX];
  143. int    ro_tflag;/*added for start(), complete() */
  144. int     ro_xf2, ro_uf2, ro_mcnt2;
  145.  
  146. /******** END OF FILE ***********************************/
  147.  
  148.  
  149.